//
//  GUIdeViewController.m
//  GiftSpeak
//
//  Created by dllo on 15/10/9.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "GUIdeViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface GUIdeViewController ()

@end

@implementation GUIdeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self guideView];
}

- (void)guideView
{
    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    scrollView.contentSize = CGSizeMake(WIDTH * 4, 0);
    scrollView.pagingEnabled = YES;
    scrollView.bounces = NO;
    
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,WIDTH , HEIGHT)];
    [imageView setImage:[UIImage imageNamed:@"引导页1.jpg"]];
    [scrollView addSubview:imageView];
    [imageView release];
    
    UIImageView *imageViewTwo = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH, 0,WIDTH , HEIGHT)];
    [imageViewTwo setImage:[UIImage imageNamed:@"引导页2.jpg"]];
    [scrollView addSubview:imageViewTwo];
    [imageViewTwo release];
    
    UIImageView *imageViewThree = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH * 2, 0,WIDTH , HEIGHT)];
    [imageViewThree setImage:[UIImage imageNamed:@"引导页3.jpg"]];
    [scrollView addSubview:imageViewThree];
    [imageViewThree release];
    
    UIImageView *imageViewLast = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH * 3, 0,WIDTH , HEIGHT)];
    [imageViewLast setImage:[UIImage imageNamed:@"引导页4.jpg"]];
    [scrollView addSubview:imageViewLast];
    imageViewLast.userInteractionEnabled = YES;
    [imageViewLast release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:nil forState:UIControlStateNormal];
    [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, HEIGHT / 4 * 3, WIDTH, HEIGHT / 4);
    [imageViewLast addSubview:button];
    [self.view addSubview:scrollView];
    [scrollView release];
}

- (void)click
{
    self.block();
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
